/**
 * Created by zybang on 2017/6/27.
 *
 *
 * 判断一个整数是否是回文
 *
 */
public class palindromeNumber {
    public static void main(String[] args){
        int num=11;
        solution(num);
    }
    private static void solution(int num){
        String s = "" + num;
        int i;
        int j;
        if(s.length()%2 == 1)
        {
            j = (s.length()+1)/2;
            i = j-2;
        }

        else
        {
            j = s.length()/2;
            i = j-1;
        }

        System.out.print(i+"  "+j);
            System.out.println(test(i,j, s));


    }

    private static boolean test(int i , int j, String s){

        while (i>=0 && j<s.length())
        {

            if(s.charAt(i) == s.charAt(j))
            {
                i--;
                j++;

            }
            else {

                return false;
            }
        }
        if(j == s.length())
            return true;
        return false;
    }
}
